package icom.icss.register;

import icom.icss.entity.User;
import icom.icss.utils.JDBCUtils;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class UserServive {
    public void register(User user) throws SQLException {
        PreparedStatement statement = null;
        Connection connection = null;
        connection = JDBCUtils.getConnection();

        String sql = "INSERT INTO admin(username,password) VALUES (?,?)";
        statement = connection.prepareStatement(sql);
        statement.setString(1, user.getUsername());
        statement.setString(2, user.getPassword());

        statement.executeUpdate();


        JDBCUtils.realease(null,statement, connection);


    }
}
